set( MAJOR_VERSION 2)
SET(MINOR_VERSION 2)
if (${VERSION}.x STREQUAL ".x")
   if (MSVC)
      message("windows: Extracting git software version")
      execute_process(COMMAND powershell "(git rev-list --branches HEAD | Measure-Object -line).Lines" OUTPUT_VARIABLE GIT_VERSION WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
   else()
      if(UNIX OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
         message("nix: Extracting git software version")
      else()
         message("unknown platform: extracting git software version")
      endif()
      execute_process(COMMAND bash "-c" "git rev-list --branches HEAD | wc -l | tr -d ' ' | tr -d '\n'" OUTPUT_VARIABLE GIT_VERSION WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
   endif() 
   MESSAGE("VERSION SO FAR ${GIT_VERSION}")
   math(EXPR VERSION-BASE ${GIT_VERSION}/255)       # TODO the math lines can just be commented out when debugging in VSCode. 
   math(EXPR VERSION-REMAINDER ${GIT_VERSION}%255)  # as the GIT_VERSION can not easily be retrieved in VS 
   SET(BUILD_NUMBER ${VERSION-BASE})
   SET(VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_NUMBER}-${VERSION-REMAINDER})
endif()
message("Software Version: ${VERSION}")
